package org.extremengine.shape;

import org.extremengine.common.Point;

/**
 * 无限长垂直线。
 * @author yuxing
 * 
 */
public class VerticalLine extends UnlimitedLine {

	private double x;

	public VerticalLine(double x) {
		super();
		this.x = x;
	}

	public VerticalLine(double x, int freeSpace) {
		super(freeSpace);
		this.x = x;
	}

	@Override
	public Point getBarycenter() {
		throw new UnsupportedOperationException();
	}

	@Override
	public void transform(double deltax, double deltay) {
		this.x += deltax;
	}

	public double getX() {
		return x;
	}

	public void setX(double x) {
		this.x = x;
	}

	@Override
	public String toString() {
		return "VLine:" + x;
	}

	@Override
	public Shape clone() {
		return new VerticalLine(this.x);
	}
}
